import App from './App';
import messages from './locale/index'

let i18nConfig = {
  locale: uni.getLocale(),
  messages
}

// #ifndef VUE3
import Vue from 'vue';
Vue.use(VueI18n);
import VueI18n from 'vue-i18n'
const i18n = new VueI18n(i18nConfig)

// Vue.prototype.$i18n = i18n;

Vue.config.productionTip = false;

import store from '@/Vuex/store.js';
import commonFun from './static/js/common.js';
Vue.prototype.$commonFun = commonFun;

import { getDictionaryData, formatLink } from '@/utils/utils.js';
Vue.prototype.getDictionaryData = getDictionaryData;
Vue.prototype.formatLink = formatLink;

import uView from 'uview-ui';
Vue.use(uView);

import moment from 'moment';
Vue.prototype.$moment = moment;
// import chanModal from "./components/modal.vue"
// Vue.component('chanModal',chanModal)
// 混入
import { mixin } from './utils/mixin.js';
Vue.mixin(mixin);

import VConsole from 'vconsole';
if (process.env.NODE_ENV !== 'production') {
	const vConsole = new VConsole();
}

App.mpType = 'app';
const app = new Vue({
	i18n,
	store,
	...App,
});
app.$mount();
// #endif

// #ifdef VUE3

import { createSSRApp } from 'vue';
import { createI18n } from 'vue-i18n'
export function createApp() {
	const app = createSSRApp(App);
	app.use(i18n)
	return {
		app,
	};
}
// #endif
